package com.chuangjiangx.member.manager.client.web.stored.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * @author cj-ch
 * @date 2018/4/4 下午3:51
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "会员卡(b扫c)快捷支付请求参数")
public class MbrQuickPayRequest {

    /**
     * 授权付款码,会员付款码固定22长度
     */
    @ApiModelProperty(value = "授权付款码")
    @Size(min = 22,max = 22,message = "授权付款码长度不符合")
    private String authCode;

    /**
     * 会员Id
     */
    @ApiModelProperty(value = "会员Id,与会员付款码互斥")
    @Min(value = 1,message = "会员Id必须大于等于1")
    private Long memberId;
    /**
     * 会员手机后4位
     */
    @ApiModelProperty(value = "会员手机后4位,与会员Id一起使用,与会员付款码互斥")
    @Size(min = 4,max = 4,message = "会员手机号码后4位,长度不符合")
    private String memberMobileLast4;

    /**
     * 付款金额
     */
    @NotNull
    @ApiModelProperty(value = "付款金额",required = true)
    @DecimalMin(value = "0.01",message = "付款金额不能小于0.01元")
    private BigDecimal amount;

    /**
     * 支付终端
     */
    @ApiModelProperty(value = "支付终端",required = true)
    @NotNull(message = "退款终端不能为null")
    private Integer payTerminal;

    @ApiModelProperty(value = "卡券核销码")
    @Size(min = 13,max = 13,message = "卡券核销码长度为13位")
    private String couponCode;
}
